import { http } from "@/utils/http";

export type ListResult = {
    code: number;
    data: {
        count: number;
        data: [
            {
                id: string;
                userId: string;
                createTime: Date;
                updateTime: Date;
            }
        ]
    };
    msg: string;
};

export type Result = {
    code: number;
    data: any;
    msg: string;
};

export type AddResult = {
    code: number;
    data: {
        id: string;
    };
    msg: string;
};

export type getListResult = {
    code: number;
    data: {
        count: number;
        data: [
            {
                id: string
                createTime: string,
                updateTime: string
                userId: string
                jobTitle: string
                address: string
                company: string
                mail: string
            }
        ]
    };
    msg: string;
};


export const getList = (params?: object) => {
    return http.request<ListResult>("get", "/api/enterprise/companyResume/list", { params });
};
export const get = (params?: object) => {
    return http.request<Result>("get", "/api/enterprise/companyResume/" + params);
};
export const add = (data?: object) => {
    return http.request<Result>("post", "/api/enterprise/companyResume/add", { data });
};
export const update = (data?: object) => {
    return http.request<Result>("put", "/api/enterprise/companyResume/update", { data });
};
export const deleted = (params?: object) => {
    return http.request<Result>("delete", "/api/enterprise/companyResume/" + params);
};
export const list = (params?: object) => {
    return http.request<getListResult>("get", "/api/enterprise/recruitingList/getList" , { params });
};
